package xyz.hubery.feign;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.hubery.dto.MarketDto;
import xyz.hubery.dto.TradeDTO;

import java.util.List;

@FeignClient(name = "exchange-service",contextId = "marketServiceFeign", configuration = ClientCredentialsFeignInterceptor.class,path = "/markets")
public interface MarketServiceFeign {

    @GetMapping("/getMarket")
    MarketDto getMarket(@RequestParam Long sellCoinId, @RequestParam Long buyCoinId);

    @GetMapping("/getMarketBySymbol")
    MarketDto findBySymbol(@RequestParam String symbol);


    /**
     * 获取所有的交易市场
     * @return
     */
    @GetMapping("/getAllMarkets")
    List<MarketDto> findAllMarkets();



    /**
     * 获取深度数据
     * @param symbol 交易对
     * @param step 深度类型
     * @return
     */
    @GetMapping("/getDepthData")
    String findDepthData(@RequestParam String symbol, @RequestParam Integer step);

    /**
     * 获取市场下所有的交易记录
     * @param id 市场id
     * @return 成交记录列表
     */
    @GetMapping("/trades")
    List<TradeDTO> getAllTradesById(@RequestParam Long id);
}
